package com.aos.erp.schools.rest.student;

import com.aos.erp.common.bean.ResultEntity;
import com.aos.erp.schools.cutils.router.Rest;
import com.aos.erp.schools.model.student.Student;
import com.aos.erp.schools.model.student.StudentPicture;
import com.aos.erp.schools.model.student.ro.picture.AddStudentPictureRo;
import com.aos.erp.schools.service.student.StudentPictureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @Auther: chb
 * @Date: 2018/11/1 19:22
 * @Description:  学员资源管理
 */
@RestController
@RequestMapping(Rest.StudentPicture.ROOT)
@Api(tags = {"学员资源管理"})
public class StudentPictureController {

    @Autowired
    private StudentPictureService studentPictureService;


    @PostMapping(Rest.StudentPicture.add)
    @ApiOperation(value = "学员资源添加")
    public ResultEntity addStudentPicture(AddStudentPictureRo addStudentPictureRo){

        try {
            StudentPicture sp=new StudentPicture();
            BeanUtils.copyProperties(addStudentPictureRo,sp);
            studentPictureService.addBean(sp);
            return ResultEntity.success("学员资源成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return ResultEntity.failed("学员资源添加失败!");
        }

    }








}
